@charset "UTF-8";
@use "sass:color";
@use "sass:map";
@use "@/styles/variables.scss" as *;

/* IM聊天模块样式 - 现代化设计，与博客主题一致 */
.im-container {
  // === 布局控制 - 防止水平滚动条 ===
  width: 100%;
  max-width: 100%;
  overflow-x: hidden; // 隐藏水平滚动条
  box-sizing: border-box;

  // === 主色系统 ===
  --im-color-primary: #{$primary};
  --im-color-secondary: #{$secondary};

  // 主色渐变变体
  --im-color-primary-light-1: #{color.mix(white, $primary, 10%)};
  --im-color-primary-light-2: #{color.mix(white, $primary, 20%)};
  --im-color-primary-light-3: #{color.mix(white, $primary, 30%)};
  --im-color-primary-light-4: #{color.mix(white, $primary, 40%)};
  --im-color-primary-light-5: #{color.mix(white, $primary, 50%)};
  --im-color-primary-light-6: #{color.mix(white, $primary, 60%)};
  --im-color-primary-light-7: #{color.mix(white, $primary, 70%)};
  --im-color-primary-light-8: #{color.mix(white, $primary, 80%)};
  --im-color-primary-light-9: #{color.mix(white, $primary, 90%)};

  // 主色深色变体
  --im-color-primary-dark-1: #{color.mix(black, $primary, 10%)};
  --im-color-primary-dark-2: #{color.mix(black, $primary, 20%)};

  // === 状态颜色系统 ===
  --im-color-success: #67c23a;
  --im-color-warning: #e6a23c;
  --im-color-danger: #f56c6c;
  --im-color-info: #909399;

  // === 文字系统 ===
  --im-text-color-primary: var(--text-primary);
  --im-text-color-secondary: var(--text-secondary);
  --im-text-color-placeholder: #{color.mix(white, $text-secondary, 30%)};
  --im-text-color-disabled: #{color.mix(white, $text-secondary, 60%)};

  // === 字体系统 ===
  --im-font-size-xs: 11px;
  --im-font-size-sm: 13px;
  --im-font-size-base: 14px;
  --im-font-size-lg: 16px;
  --im-font-size-xl: 18px;
  --im-font-size-xxl: 20px;
  --im-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  // 字体权重
  --im-font-weight-light: 300;
  --im-font-weight-normal: 400;
  --im-font-weight-medium: 500;
  --im-font-weight-semibold: 600;
  --im-font-weight-bold: 700;

  // === 边框与阴影系统 ===
  --im-border-color: var(--border-color, rgba(0, 0, 0, 0.1));
  --im-border-color-light: rgba(0, 0, 0, 0.05);
  --im-border: 1px solid var(--im-border-color);
  --im-border-light: 1px solid var(--im-border-color-light);
  --im-box-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --im-box-shadow-base: 0 4px 12px rgba(0, 0, 0, 0.1);
  --im-box-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --im-box-shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.08);

  // === 背景色系统 ===
  --im-bg-primary: var(--surface, #ffffff);
  --im-bg-secondary: var(--hover-bg, #f8f9fa);
  --im-bg-tertiary: var(--card-bg, #ffffff);
  --im-bg-active: var(--im-color-primary-light-9);
  --im-bg-hover: var(--hover-bg, rgba(64, 158, 255, 0.05));

  // === 圆角系统 ===
  --im-border-radius-xs: 2px;
  --im-border-radius-sm: 4px;
  --im-border-radius-base: 6px;
  --im-border-radius-lg: 8px;
  --im-border-radius-xl: 12px;
  --im-border-radius-round: 50%;

  // === 间距系统 ===
  --im-spacing-xs: 4px;
  --im-spacing-sm: 8px;
  --im-spacing-base: 12px;
  --im-spacing-lg: 16px;
  --im-spacing-xl: 20px;
  --im-spacing-xxl: 24px;

  // === 动画系统 ===
  --im-transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --im-transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --im-transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);

  // === 基础布局 ===
  height: 100%;
  overflow: hidden;
  font-family: var(--im-font-family);
  color: var(--im-text-color-primary);

  // 防止页面滚动条
  &.home-page {
    overflow: hidden !important;

    .app-container {
      max-width: 100vw;
      box-sizing: border-box;
      overflow: hidden;
    }
  }

  // === 页面切换动画 ===
  .router-view {
    animation: fadeIn 0.3s ease-in-out;
  }

  // 列表项进入动画
  .chat-item,
  .friend-item,
  .group-item {
    animation: slideInRight 0.2s ease-out;
  }

  // 消息项动画
  .message-item {
    animation: fadeIn 0.2s ease-out;
  }

  // === 滚动条样式 ===
  // 默认隐藏所有滚动条
  ::-webkit-scrollbar {
    width: 0;
    height: 0;
    background: transparent;
  }

  // 只在特定区域显示滚动条
  .im-chat-main,
  .el-scrollbar__wrap {
    ::-webkit-scrollbar {
      width: 6px;
      height: 6px;
    }

    ::-webkit-scrollbar-track {
      background: transparent;
      border-radius: var(--im-border-radius-sm);
    }

    ::-webkit-scrollbar-thumb {
      background: var(--im-color-primary-light-6);
      border-radius: var(--im-border-radius-sm);
      transition: background var(--im-transition-fast);

      &:hover {
        background: var(--im-color-primary-light-4);
      }
    }

    ::-webkit-scrollbar-corner {
      background: transparent;
    }
  }

  // 聊天输入区域的滚动条
  .chat-input-area .edit-chat-container {
    ::-webkit-scrollbar {
      width: 4px;
      height: 4px;
    }

    ::-webkit-scrollbar-track {
      background: transparent;
    }

    ::-webkit-scrollbar-thumb {
      background: var(--im-color-primary-light-7);
      border-radius: var(--im-border-radius-xs);

      &:hover {
        background: var(--im-color-primary-light-5);
      }
    }
  }

  // === 空状态样式 ===
  .empty-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: var(--im-spacing-xxl);
    text-align: center;
    background: var(--im-bg-secondary);

    .empty-icon {
      font-size: 48px;
      color: var(--im-color-primary-light-6);
      margin-bottom: var(--im-spacing-lg);
      opacity: 0.8;
    }

    .empty-text {
      font-size: var(--im-font-size-base);
      color: var(--im-text-color-secondary);
      line-height: 1.5;
      margin: 0;
    }

    .empty-subtext {
      font-size: var(--im-font-size-sm);
      color: var(--im-text-color-placeholder);
      margin-top: var(--im-spacing-sm);
    }
  }

  // 右侧内容区空状态
  .content-empty-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    background: var(--im-bg-primary);
    padding: var(--im-spacing-xxl);

    .welcome-icon {
      font-size: 64px;
      color: var(--im-color-primary-light-7);
      margin-bottom: var(--im-spacing-xl);
      opacity: 0.6;
    }

    .welcome-title {
      font-size: var(--im-font-size-xl);
      color: var(--im-text-color-primary);
      margin-bottom: var(--im-spacing-base);
      font-weight: 500;
    }

    .welcome-desc {
      font-size: var(--im-font-size-base);
      color: var(--im-text-color-secondary);
      line-height: 1.6;
      text-align: center;
      max-width: 300px;
    }
  }

  // === 搜索输入框样式 ===
  .search-input,
  .search-text {
    .el-input__inner {
      border: var(--im-border-light) !important;
      border-radius: var(--im-border-radius-lg) !important;
      background: var(--im-bg-secondary) !important;
      color: var(--im-text-color-primary) !important;
      font-size: var(--im-font-size-base) !important;
      padding: 0 var(--im-spacing-base) 0 40px !important; // 左侧留出图标空间
      transition: all var(--im-transition-base) !important;

      &::placeholder {
        color: var(--im-text-color-placeholder) !important;
      }

      &:focus {
        border-color: var(--im-color-primary) !important;
        box-shadow: 0 0 0 2px var(--im-color-primary-light-8) !important;
        background: var(--im-bg-primary) !important;
      }

      &:hover:not(:focus) {
        border-color: var(--im-color-primary-light-4) !important;
      }
    }

    .el-input__prefix,
    .el-input__icon {
      color: var(--im-text-color-secondary) !important;
      transition: color var(--im-transition-fast) !important;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      height: 100% !important;
      width: 32px !important; // 固定图标宽度
      position: absolute !important;
      left: 8px !important; // 图标位置
      z-index: 1 !important;
    }

    &:hover .el-input__prefix,
    &:hover .el-input__icon {
      color: var(--im-color-primary) !important;
    }
  }

  // === 内容区域样式 ===
  .content-box {
    background: var(--im-bg-primary) !important;
    border-radius: var(--im-border-radius-lg);
    overflow: hidden;

    // 聊天消息区域
    .message-list-container {
      border-radius: var(--im-border-radius-lg);
      overflow: hidden;
      background: var(--im-bg-primary);
    }

    // 通用按钮样式
    .btn,
    button:not(.el-button) {
      border-radius: var(--im-border-radius-base);
      transition: all var(--im-transition-base);
      border: none;
      outline: none;

      &:hover {
        transform: translateY(-1px);
        box-shadow: var(--im-box-shadow-hover);
      }

      &:active {
        transform: translateY(0);
      }
    }
  }

  // === 头像样式 ===
  .avatar {
    border-radius: var(--im-border-radius-round);
    overflow: hidden;
    box-shadow: var(--im-box-shadow-sm);
    transition: all var(--im-transition-fast);

    &:hover {
      box-shadow: var(--im-box-shadow-base);
      transform: scale(1.02);
    }
  }

  // 聊天消息中的头像样式由组件自己控制，避免冲突
  .message-container {

    .avatar-wrapper,
    .avatar-container {
      // 重置可能的全局样式影响
      transform: none !important;
      transition: none !important;

      &:hover {
        transform: none !important;
      }
    }
  }

  // === 消息气泡样式 ===
  .message-bubble {
    border-radius: var(--im-border-radius-lg);
    padding: var(--im-spacing-base) var(--im-spacing-lg);
    position: relative;
    max-width: 65%;
    word-break: break-word;
    line-height: 1.4;
    font-size: var(--im-font-size-base);
    box-shadow: var(--im-box-shadow-sm);
    margin: var(--im-spacing-xs) 0;

    // 发送方消息气泡
    &.self {
      background: linear-gradient(135deg, var(--im-color-primary), var(--im-color-primary-light-1));
      color: white;
      margin-left: auto;
      border-bottom-right-radius: var(--im-border-radius-base);

      &::before {
        content: '';
        position: absolute;
        right: -6px;
        bottom: 8px;
        width: 0;
        height: 0;
        border: 6px solid transparent;
        border-left-color: var(--im-color-primary);
        border-right: none;
      }
    }

    // 接收方消息气泡
    &:not(.self) {
      background: var(--im-bg-tertiary);
      color: var(--im-text-color-primary);
      border: var(--im-border-light);
      border-bottom-left-radius: var(--im-border-radius-base);

      &::before {
        content: '';
        position: absolute;
        left: -6px;
        bottom: 8px;
        width: 0;
        height: 0;
        border: 6px solid transparent;
        border-right-color: var(--im-bg-tertiary);
        border-left: none;
      }
    }

    // 消息内容
    .message-content {
      margin: 0;
      word-wrap: break-word;
    }

    // 消息时间
    .message-time {
      font-size: var(--im-font-size-xs);
      opacity: 0.7;
      margin-top: var(--im-spacing-xs);
    }
  }

  // === 列表项样式 ===
  .chat-item,
  .friend-item,
  .group-item {
    cursor: pointer;
    padding: var(--im-spacing-lg) var(--im-spacing-lg);
    border-radius: var(--im-border-radius-lg);
    margin: var(--im-spacing-sm) var(--im-spacing-xs);
    transition: all 0.2s ease;
    position: relative;
    background: transparent;
    border: 1px solid transparent;
    overflow: hidden;

    // 禁用右键菜单显示时的动画，防止闪动
    &.context-menu-active {
      transition: none !important;
      transform: none !important;
      animation: none !important;
    }

    // 添加微妙的背景渐变
    &::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.02) 100%);
      opacity: 0;
      transition: opacity var(--im-transition-base);
    }

    &:hover:not(.context-menu-active) {
      background: var(--im-bg-hover);
      transform: translateX(4px) translateY(-1px);
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
      border-color: var(--im-color-primary-light-8);

      &::before {
        opacity: 1;
      }

      .item-badge {
        transform: scale(1);
      }
    }

    &.active {
      background: var(--im-bg-active);
      box-shadow: 0 6px 20px rgba(64, 158, 255, 0.2);
      border-left: 4px solid var(--im-color-primary);
      transform: translateX(4px);

      &::after {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 4px;
        background: linear-gradient(180deg, var(--im-color-primary), var(--im-color-primary-light-2));
        border-radius: 0 var(--im-border-radius-sm) var(--im-border-radius-sm) 0;
      }

      .item-badge {
        transform: scale(1);
      }
    }

    // 列表项内容
    .item-content {
      display: flex;
      align-items: center;
      gap: var(--im-spacing-lg);

      .item-avatar {
        flex-shrink: 0;
        width: 44px;
        height: 44px;
        border-radius: var(--im-border-radius-circle);
        overflow: hidden;
        position: relative;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
        transition: all var(--im-transition-base);

        img {
          width: 100%;
          height: 100%;
          object-fit: cover;
          transition: transform var(--im-transition-base);
        }

        // 头像悬停效果
        &:hover img {
          transform: scale(1.05);
        }

        // 在线状态指示器
        &::after {
          content: '';
          position: absolute;
          bottom: 2px;
          right: 2px;
          width: 10px;
          height: 10px;
          background: var(--im-color-success);
          border: 2px solid white;
          border-radius: 50%;
          opacity: 0;
          transition: opacity var(--im-transition-base);
        }

        &.online::after {
          opacity: 1;
        }
      }

      .item-info {
        flex: 1;
        min-width: 0;

        .item-name {
          font-size: var(--im-font-size-base);
          font-weight: var(--im-font-weight-semibold);
          color: var(--im-text-color-primary);
          margin-bottom: 4px;
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
          line-height: 1.3;
          font-family: var(--im-font-family);
        }

        .item-desc {
          font-size: var(--im-font-size-sm);
          font-weight: var(--im-font-weight-normal);
          color: var(--im-text-color-secondary);
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
          line-height: 1.4;
          font-family: var(--im-font-family);
        }
      }

      .item-meta {
        flex-shrink: 0;
        text-align: right;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;

        .item-time {
          font-size: var(--im-font-size-xs);
          color: var(--im-text-color-placeholder);
          font-weight: var(--im-font-weight-normal);
          font-family: var(--im-font-family);
          line-height: 1.2;
        }

        .item-badge {
          background: linear-gradient(135deg, var(--im-color-danger), #ff7875);
          color: white;
          font-size: var(--im-font-size-xs);
          font-weight: var(--im-font-weight-semibold);
          font-family: var(--im-font-family);
          padding: 3px 8px;
          border-radius: 12px;
          min-width: 18px;
          text-align: center;
          box-shadow: 0 2px 4px rgba(245, 108, 108, 0.3);
          transform: scale(0.9);
          transition: all var(--im-transition-base);
          border-radius: var(--im-border-radius-round);
          min-width: 16px;
          text-align: center;
        }
      }
    }
  }

  // === 输入框容器样式 ===
  .input-container {
    border-top: var(--im-border);
    padding: var(--im-spacing-lg);
    background: var(--im-bg-primary);

    .toolbar {
      display: flex;
      align-items: center;
      gap: var(--im-spacing-base);
      margin-bottom: var(--im-spacing-base);
      padding: var(--im-spacing-sm) 0;

      .tool-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        color: var(--im-text-color-secondary);
        font-size: 16px;
        cursor: pointer;
        border-radius: var(--im-border-radius-base);
        transition: all var(--im-transition-fast);
        background: transparent;
        border: none;

        &:hover {
          color: var(--im-color-primary);
          background: var(--im-bg-hover);
          transform: scale(1.1);
        }

        &:active {
          transform: scale(0.95);
        }

        &.active {
          color: var(--im-color-primary);
          background: var(--im-bg-active);
        }
      }
    }

    .input-area {
      border: var(--im-border);
      border-radius: var(--im-border-radius-lg);
      background: var(--im-bg-primary);
      transition: all var(--im-transition-base);

      &:focus-within {
        border-color: var(--im-color-primary);
        box-shadow: 0 0 0 2px var(--im-color-primary-light-8);
      }
    }
  }

  // === 按钮通用样式 ===
  .el-button:not(.is-disabled) {
    border-radius: var(--im-border-radius-base) !important;
    transition: all var(--im-transition-base) !important;

    &:hover,
    &:focus {
      transform: translateY(-1px) !important;
      box-shadow: var(--im-box-shadow-hover) !important;
    }

    &:active {
      transform: translateY(0) !important;
    }
  }

  // === 页面侧边栏样式 ===
  .chat-page .aside,
  .friend-page .aside,
  .group-page .aside {
    border-right: var(--im-border);
    box-shadow: var(--im-box-shadow-sm);
    background: var(--im-bg-tertiary);
  }

  .chat-page .aside .header,
  .friend-page .aside .header,
  .group-page .aside .header {
    height: 50px;
    border-bottom: var(--im-border);
    background: var(--im-bg-tertiary);
    display: flex;
    align-items: center;
    padding: 0 var(--im-spacing-lg);
    font-weight: 500;
    color: var(--im-text-color-primary);
  }

  // === 主导航侧边栏样式 ===
  .app-container .aside {
    background: var(--im-bg-tertiary);
    border-right: var(--im-border);

    .menu {
      display: flex;
      flex-direction: column;
      gap: var(--im-spacing-xs);
      padding: var(--im-spacing-base);

      .link {
        text-decoration: none;
        border-radius: var(--im-border-radius-lg);
        overflow: hidden;
        transition: all var(--im-transition-base);

        &:hover {
          transform: translateX(2px);
        }

        &.router-link-active {
          .menu-item {
            background: var(--im-color-primary);
            color: white;
            box-shadow: var(--im-box-shadow-base);

            i {
              transform: scale(1.1);
            }
          }
        }

        .menu-item {
          display: flex;
          align-items: center;
          justify-content: center;
          padding: var(--im-spacing-lg);
          color: var(--im-text-color-secondary);
          transition: all var(--im-transition-base);
          position: relative;
          border-radius: var(--im-border-radius-lg);

          &:hover:not(.router-link-active .menu-item) {
            background: var(--im-bg-hover);
            color: var(--im-color-primary);
          }

          i {
            font-size: 20px;
            transition: all var(--im-transition-base);
          }

          .unread-text {
            position: absolute;
            top: 6px;
            right: 6px;
            background: var(--im-color-danger);
            color: white;
            font-size: var(--im-font-size-xs);
            padding: 2px 6px;
            border-radius: var(--im-border-radius-round);
            min-width: 16px;
            text-align: center;
            font-weight: 500;
            animation: pulse 2s infinite;
            box-shadow: var(--im-box-shadow-sm);
          }
        }
      }
    }
  }
}



// === 底部控制按钮样式 ===
.bottom-controls {
  display: flex;
  flex-direction: column;
  gap: var(--im-spacing-sm);
  padding: var(--im-spacing-lg);
  border-top: var(--im-border);
  background: var(--im-bg-tertiary);

  .control-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--im-border-radius-lg);
    cursor: pointer;
    transition: all var(--im-transition-base);
    background: transparent;
    color: var(--im-text-color-secondary);
    position: relative;
    border: none;
    outline: none;

    &:hover {
      background: var(--im-bg-hover);
      color: var(--im-color-primary);
      transform: translateY(-2px);
      box-shadow: var(--im-box-shadow-hover);
    }

    &:active {
      transform: translateY(0);
      box-shadow: var(--im-box-shadow-sm);
    }

    i {
      font-size: 16px;
      transition: all var(--im-transition-base);
    }

    // 主题切换按钮
    &.theme-toggle {
      i.fa-moon {
        color: #4a90e2;
      }

      i.fa-sun {
        color: #f39c12;
      }

      &:hover {
        i.fa-moon {
          color: #357abd;
        }

        i.fa-sun {
          color: #e67e22;
        }
      }
    }

    // 全屏按钮
    &.fullscreen-toggle {
      &:hover {
        color: var(--im-color-primary);
      }
    }

    // 设置按钮
    &.settings-btn {
      &:hover {
        color: var(--im-color-info);
      }
    }

    // 退出按钮
    &.exit-btn {
      &:hover {
        background: rgba(245, 108, 108, 0.1);
        color: var(--im-color-danger);
      }
    }

    // 按钮提示文字
    &[title] {
      position: relative;

      &::after {
        content: attr(title);
        position: absolute;
        left: 50px;
        top: 50%;
        transform: translateY(-50%);
        background: var(--im-text-color-primary);
        color: var(--im-bg-primary);
        padding: var(--im-spacing-xs) var(--im-spacing-sm);
        border-radius: var(--im-border-radius-base);
        font-size: var(--im-font-size-xs);
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--im-transition-fast);
        z-index: 1000;
      }

      &:hover::after {
        opacity: 1;
      }
    }
  }
}

// === 表情符号样式 ===
.emoji-large {
  width: 32px;
  height: 32px;
  vertical-align: bottom;
  border-radius: var(--im-border-radius-sm);
}

.emoji-normal {
  width: 26px;
  height: 26px;
  vertical-align: bottom;
  border-radius: var(--im-border-radius-xs);
}

.emoji-small {
  width: 20px;
  height: 20px;
  vertical-align: bottom;
  border-radius: var(--im-border-radius-xs);
}

// === 通用动画效果 ===
.hover-float {
  transition: transform var(--im-transition-base);

  &:hover {
    transform: translateY(-2px);
  }
}

.pulse-animation {
  animation: pulse 1.5s infinite;
}

// === 在线状态指示器 ===
.online-indicator {
  width: 8px;
  height: 8px;
  border-radius: var(--im-border-radius-round);
  background: var(--im-color-success);
  position: absolute;
  bottom: 2px;
  right: 2px;
  border: 2px solid var(--im-bg-primary);
  box-shadow: 0 0 0 1px rgba(103, 194, 58, 0.3);
}

// === 动画定义 ===
@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

// === 深色模式适配 ===
:root[data-theme='dark'] {
  .im-container {
    // 重写深色模式下的颜色变量
    --im-bg-primary: #{map.get($dark, surface)};
    --im-bg-secondary: #{map.get($dark, hover-bg)};
    --im-bg-tertiary: #{map.get($dark, card-bg)};
    --im-bg-active: rgba(64, 158, 255, 0.15); // 深色模式下的选中背景
    --im-bg-hover: rgba(64, 158, 255, 0.08); // 深色模式下的悬停背景
    --im-text-color-primary: #{map.get($dark, text-primary)};
    --im-text-color-secondary: #{map.get($dark, text-secondary)};
    --im-text-color-placeholder: rgba(255, 255, 255, 0.4); // 深色模式下的占位符文字
    --im-border-color: #{map.get($dark, border)};
    --im-border-color-light: rgba(255, 255, 255, 0.05);

    // 深色模式下的代码和内容背景
    --im-code-bg: linear-gradient(135deg, #{map.get($dark, hover-bg)} 0%, #{map.get($dark, surface)} 100%);
    --im-pre-bg: linear-gradient(135deg, #{map.get($dark, hover-bg)} 0%, #{map.get($dark, surface)} 100%);
    --im-table-header-bg: #{map.get($dark, hover-bg)};
    --im-response-bg: linear-gradient(135deg, #{map.get($dark, hover-bg)} 0%, #{map.get($dark, surface)} 100%);

    // 深色模式下的消息气泡
    .message-bubble {
      &.self {
        background: linear-gradient(135deg, var(--im-color-primary-dark-1), var(--im-color-primary));
      }

      &:not(.self) {
        background: var(--im-bg-tertiary);
        border-color: var(--im-border-color);
      }
    }

    // 深色模式下的混合消息特殊样式
    .message-mixed {
      .mixed-bubble {
        // 自发送消息在深色模式下的样式
        &.self {
          background: linear-gradient(135deg, var(--im-color-primary-dark-1), var(--im-color-primary)) !important;

          .mixed-text {
            color: rgba(255, 255, 255, 0.95) !important;

            .at-user {
              color: rgba(255, 255, 255, 0.9) !important;
              background: rgba(255, 255, 255, 0.2) !important;
            }
          }
        }

        // 接收消息在深色模式下的样式
        &:not(.self) {
          background: var(--im-bg-tertiary) !important;
          border: 1px solid var(--im-border-color) !important;

          .mixed-text {
            color: var(--im-text-color-primary) !important;

            .at-user {
              color: var(--im-color-primary) !important;
              background: rgba(var(--im-color-primary-rgb), 0.15) !important;
            }
          }
        }

        .mixed-item {
          .mixed-image-wrapper {
            // 深色模式下图片容器的阴影效果
            box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);

            &:hover {
              box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
            }
          }
        }
      }
    }

    // 深色模式下的滚动条
    .chat-content .im-chat-main,
    .im-chat-main {
      ::-webkit-scrollbar-thumb {
        background: var(--im-color-primary-dark-1);

        &:hover {
          background: var(--im-color-primary);
        }
      }
    }

    // 深色模式下的空状态
    .content-empty-state {
      background: var(--im-bg-primary);
    }

    // 深色模式下的底部控制按钮
    .bottom-controls {
      background: var(--im-bg-tertiary);
      border-top-color: var(--im-border-color);

      .control-item {
        &:hover {
          background: var(--im-bg-hover);
        }
      }
    }

    // 深色模式下的好友页面
    .friend-page {
      .aside {
        background: var(--im-bg-tertiary) !important;
        border-right-color: var(--im-border-color) !important;

        .header {
          background: var(--im-bg-tertiary) !important;
          border-bottom-color: var(--im-border-color) !important;
        }

        .letter {
          color: var(--im-text-color-secondary) !important;
        }
      }

      .friend-info {
        .info-item {
          background: var(--im-bg-tertiary) !important;
          border-color: var(--im-border-color) !important;
        }
      }

      .container .header {
        background: var(--im-bg-primary) !important;
        color: var(--im-text-color-primary) !important;
        border-bottom-color: var(--im-border-color) !important;
      }
    }

    // 深色模式下的好友项
    .friend-item {
      color: var(--im-text-color-primary) !important;

      .friend-name {
        color: var(--im-text-color-primary) !important;
      }

      .friend-online {
        color: var(--im-text-color-secondary) !important;
      }

      &:hover {
        background: var(--im-bg-hover) !important;
      }

      &.active {
        background: var(--im-bg-active) !important;
        border-left-color: var(--im-color-primary) !important;
      }
    }

    // 深色模式下的Element Plus组件适配
    .el-descriptions {
      background: var(--im-bg-primary) !important;

      .el-descriptions__title {
        color: var(--im-text-color-primary) !important;
      }

      .el-descriptions__label {
        color: var(--im-text-color-secondary) !important;
        background: var(--im-bg-primary) !important;
      }

      .el-descriptions__content {
        color: var(--im-text-color-primary) !important;
        background: var(--im-bg-primary) !important;
      }

      .el-descriptions__body {
        background: var(--im-bg-primary) !important;
      }

      .el-descriptions__table {
        background: var(--im-bg-primary) !important;
      }

      tr {
        background: var(--im-bg-primary) !important;
      }

      td {
        background: var(--im-bg-primary) !important;
        border-color: var(--im-border-color) !important;
      }
    }

    // 深色模式下的输入框和按钮适配
    .el-input {
      .el-input__wrapper {
        background: var(--im-bg-tertiary) !important;
        border-color: var(--im-border-color) !important;

        .el-input__inner {
          color: var(--im-text-color-primary) !important;
          background: transparent !important;

          &::placeholder {
            color: var(--im-text-color-placeholder) !important;
          }
        }
      }
    }

    .el-button {
      &.el-button--primary {
        background: var(--im-color-primary) !important;
        border-color: var(--im-color-primary) !important;

        &:hover {
          background: var(--im-color-primary-light-3) !important;
          border-color: var(--im-color-primary-light-3) !important;
        }
      }

      &.el-button--danger {
        &:hover {
          background: #f56c6c !important;
          border-color: #f56c6c !important;
        }
      }
    }

    .el-button {
      &.el-button--primary {
        background: var(--im-color-primary);
        border-color: var(--im-color-primary);

        &:hover {
          background: var(--im-color-primary-light-1);
          border-color: var(--im-color-primary-light-1);
        }
      }

      &.el-button--danger {
        background: var(--im-color-danger);
        border-color: var(--im-color-danger);

        &:hover {
          background: #ff7875;
          border-color: #ff7875;
        }
      }
    }
  }

  // === 会话列表项动画 ===
  .chat-items {

    .chat-item,
    .friend-item,
    .group-item {
      animation: slideInRight 0.3s ease-out;
      animation-fill-mode: both;

      @for $i from 1 through 10 {
        &:nth-child(#{$i}) {
          animation-delay: #{$i * 0.05}s;
        }
      }
    }
  }

  // === 拉伸分隔器样式优化 ===
  .im-chat-footer {
    position: relative;

    .resizable-divider {
      &.vertical {
        background: linear-gradient(90deg, transparent, var(--im-border-color-light), transparent);

        &:hover {
          background: linear-gradient(90deg, transparent, var(--im-color-primary-light-6), transparent);
        }

        .drag-handle {
          background: var(--im-bg-primary);
          border: 1px solid var(--im-border-color-light);

          &:hover {
            border-color: var(--im-color-primary);
            background: var(--im-color-primary-light-9);
          }
        }
      }
    }
  }

  .aside {
    position: relative;

    .resizable-divider {
      &.horizontal {
        background: linear-gradient(180deg, transparent, var(--im-border-color-light), transparent);

        &:hover {
          background: linear-gradient(180deg, transparent, var(--im-color-primary-light-6), transparent);
        }

        .drag-handle {
          background: var(--im-bg-primary);
          border: 1px solid var(--im-border-color-light);

          &:hover {
            border-color: var(--im-color-primary);
            background: var(--im-color-primary-light-9);
          }
        }
      }
    }
  }
}